﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Cmini;
using Tree;

namespace CocoTest
{
    class Program
    {
        static void Main(string[] args)
        {
           var filetoread = new FileStream("test.c", FileMode.Open);
           var scanner = new Scanner(filetoread);
           var parser = new Parser(scanner);
           parser.tab = new SymbolTable(parser);
            parser.gen = new CodeGenerator();
            parser.Parse();
          // foreach(Token toks in scanner.tokenList)
            //{Console.WriteLine(toks.val+" "+toks.kind);}
            
            if (parser.errors.count == 0)
            {
                parser.gen.Decode();
                parser.gen.Interpret("C.IN");
            }
            Console.ReadKey(); 
        }
    }
}
